<template>
  <view>
    <u-calendar :show="showCalendar" :monthNum="12" :minDate="minDate" mode="range" closeOnClickOverlay @confirm="onConfirmOfCalendar" @close="onClose"></u-calendar>
  </view>
</template>

<script>
  import {formatDate} from "../../utils/jk-utils";

  export default {
    name: 'JkNoMore',
    props: {
      pageIndex: {
        type: [Number],
        default: 1
      },
      show: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        minDate: formatDate(Date.now() - 6 * 30 * 24 * 60 * 60 * 1000),
        showCalendar: false
      };
    },
    methods: {
      onClose() {
        this.$emit('close');
      },
      onConfirmOfCalendar(e) {
        this.$emit('confirm', e);
      },
    },
    watch: {
      show(newVal) {
        this.showCalendar = newVal;
      }
    }
  }
</script>
<style lang="scss" scoped>
</style>
